<html>
  <head>
    <title>购物车</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <script type="text/javascript">
        var contextPath = "${request.contextPath!}";
    </script>
    <script type="text/javascript" src="${request.contextPath!}/ftl/common.js"></script>
    <script type="text/javascript" src="${request.contextPath!}/static/cart/cart.js"></script>
    <link type="text/css" href="${request.contextPath!}/static/cart/cart.css">
  </head>

  <body>
    <div class=".container-fluid">
        <div class="row">
            <div class="col-xs-12 col-md-1"></div>
            <div class="col-xs-12 col-md-10">
                <!-- 表格 -->
                <div class="panel panel-default">
                    <table class="table" id="table">
                        <tr class="active" >
                            <td><input type="checkbox" id="selectAll" value="selectAll">全选</td>
                            <td>商品图片</td>
                            <td>描述</td>
                            <td>数量</td>
                            <td>单价</td>
                            <td>总价</td>
                        </tr>
                    <#if serverResponse.data.cartProducVoList?? && serverResponse.data.cartProducVoList?size gt 0>
                        <#list 0..(serverResponse.data.cartProducVoList!?size-1) as i>
                            <tr>
                                <td>
                                <#if (serverResponse.data.cartProducVoList[i].productChecked == 0) >
                                    <input type="checkbox" class="cbx" value="${serverResponse.data.cartProducVoList[i].id!}">
                                <#else>
                                    <input type="checkbox" class="cbx" checked value="${serverResponse.data.cartProducVoList[i].id!}">
                                </#if>
                                </td>
                                <td><img width="50px" height="50px" src="${request.contextPath!}/static/cart/image/test.jpg"></td>
                                <td valign="middle">xxxxxxxxxxxxxxxxxxxxxxxx</td>
                                <td valign="middle"><input type="text" class="form-control" id="id${serverResponse.data.cartProducVoList[i].id!}" value="${serverResponse.data.cartProducVoList[i].quantity!}" onblur="updateProductQuantity(this)" ></td>
                                <td valign="middle">${serverResponse.data.cartProducVoList[i].productPrice!}</td>
                                <td valign="middle">${serverResponse.data.cartProducVoList[i].productTotalPrice!}</td>
                            </tr>
                        </#list>
                    </#if>
                    </table>
                </div>

                <!-- 分页 -->
                <div class="navigation">
                    <input type="hidden" id="pageNum" value="${serverResponse.data.pageInfo.pageNum!}">
                    <input type="hidden" id="pages" value="${serverResponse.data.pageInfo.pages!}">
                        <div class="form-inline">
                            <div class="form-group">
                                <nav aria-label="Page navigation">
                                    <ul class="pagination" id="ul">
                                        <li>
                                            <a aria-label="Previous">
                                                <span aria-hidden="true" id="up_page">上一页</span>
                                            </a>
                                        </li>
                                        <li>
                                            <a aria-label="Next">
                                                <span aria-hidden="true" id="next_page">下一页</span>
                                            </a>
                                        </li>
                                    </ul>
                                </nav>
                            </div>
                            <!-- 结算 -->
                            <div class="form-group">
                                <button type="button" class="btn btn-warning" style="margin-right: 100px" id="delete">删除</button>
                            </div>
                            <div class="form-group">
                                <label for="exampleInputName2">合计</label>
                                <input type="text" width="100px" class="form-control" id="sum" readonly value="${serverResponse.data.cartTotalPrice!}">
                            </div>
                            <button type="submit" class="btn btn-default">去结算</button>
                        </div>
                </div>
            </div>
            <div class="col-xs-12 col-md-1"></div>
        </div>
    </div>
  </body>
</html>
